package com.pingba.entity.msg;

import com.pingba.entity.BaseEntity;
import com.pingba.util.helper.JsonHelp;

import java.util.Date;

/**
 * Created by Administrator on 2015/11/28 0028.
 */
public class MsgSubscribe extends BaseEntity{
    private long sid;
    private long userId;
    private long msgId;
    private long subscribeTime;
    private boolean deleted;


    public boolean isDeleted() {
        return deleted;
    }

    public void setDeleted(boolean deleted) {
        this.deleted = deleted;
    }

    public long getMsgId() {
        return msgId;
    }

    public void setMsgId(long msgId) {
        this.msgId = msgId;
    }

    public long getSid() {
        return sid;
    }

    public void setSid(long sid) {
        this.sid = sid;
    }

    public long getSubscribeTime() {
        return subscribeTime;
    }

    public void setSubscribeTime(long subscribeTime) {
        this.subscribeTime = subscribeTime;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public static MsgSubscribe getOne(long userId, long msgSendId) {
        MsgSubscribe subscribe = new MsgSubscribe();
        subscribe.setMsgId(msgSendId);
        subscribe.setUserId(userId);
        subscribe.setDeleted(false);
        subscribe.setSubscribeTime(new Date().getTime());
        return subscribe;
    }
    public static void main(String[] args) {
        MsgSubscribe subscribe = new MsgSubscribe();
        subscribe.setMsgId(8850);
        subscribe.setUserId(4);
        System.out.println(JsonHelp.jsonFromObject(subscribe));
    }
}
